<?php 
include 'common.php';
$cc = "SELECT * FROM config ORDER BY id ASC";
$row_123 = select($cc,$DB);
$id = (int)$_GET['id'];
$priority = '1';
if(empty($id)){
	$sql  = "SELECT * FROM publish WHERE  classification  = '{1}'";
}else{
	$sql  = "SELECT * FROM publish WHERE  classification = '{$id}'";
}
$row = select($sql,$DB);
$cc = "SELECT * FROM config ORDER BY id ASC";
$row_123 = select($cc,$DB);
?>
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title><?php echo $row_123[0]['title'] ?></title>
	<link href="<?=$website['public'];?>/web/base.css" rel="stylesheet" type="text/css" />
	<link href="<?=$website['public'];?>/web/discus.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="top">
	<div class="auto">
		<div class="nav">
			<img src="<?=$website['public'];?>/web/img/logo.png" style="width:30px; height:25px;margin:13px;" />
			<a href="../index.php">首页</a>
			<a href="/web/discus.php">讨论</a>
			<a href="/web/answers.php">问答</a>
			<a href="/web/node.php">节点</a>
			<a href="/web/tag.php">标签</a>
			<input type="text" name="name" placeholder="搜索" autocomplete="off" class="input">
			<div class="login right"><?php if ($_COOKIE['name']) {
				echo ($_COOKIE['name']);
			?>
			<a href="/web/logout.php?logout=1">退出登录</a>
			<?php
			} else { ?>
			<a href="/web/login.php">登录</a>
			<?php
			}
			 ?>
			 </div>
		</div>
	</div>
</div>
	<div class="main auto fn-clear">
		<div class="big_bj">
			<div class="gn_moble">
				<div class="list">
					<ul class="list_table">
						<li><a href="discus.php?id=1">活跃</a></li>
						<li><a href="discus.php?id=2">精华</a></li>
						<li><a href="discus.php?id=3">置顶</a></li>
						<li><a href="discus.php?id=4">最近</a></li>
					</ul>
				</div>
					<ul class="list_input fn-clear">
					<?php foreach ($row as $key => $value) { ?>
						<li class="li_st">
							<div class="tx_img left">
								<a href=""><img src="<?=$website['public'];?>/web/img/5.png" height="53" width="53"></a>
							</div>
							<?php
						$sql_version = "SELECT * FROM version WHERE  id= '{$value['area']}'";
						$row_version = select($sql_version,$DB);
						if ($row_version[0]['id'] === '1'){
						?>
							<a href="index.php?id=<?php echo $row_version[0]['id']; ?>" class="in"><?php echo $row_version[0]['AdvancedEdu']; ?></a>
						<?php } else { ?>
							<a href="index.php?id=<?php echo $row_version[0]['id']; ?>" class="in1"><?php echo $row_version[0]['AdvancedEdu']; ?></a>
						<?php } ?>
						<a href="/web/requer.php?id=<?php echo $value['id']; ?>" class="sx"><?php echo $value['title']; ?></a>
						<div class="time right">
							<?PHP
							$count = "SELECT COUNT(*) FROM publish_revert WHERE publish_id = '{$value['id']}'";
							$number = select($count,$DB);
							?>
							<div class="time right">
								<span class="left">6</span>
								<span class="left">/</span>
								<span class="left">1709</span>
								<span class="left">|</span>
								<span class="left">月</span>
							</div>	
						</li>
						<?php } ?>
					</ul>
			</div>
			<ul class="fanye left">
				<li class="am_disabled left">
					<a href=""><<</a>
				</li>
				<li class="am_active left">1</li>
				<li class="am_disabled left">
					<a href="">>></a>
				</li>
			</ul> 
		</div>
			<div class="gnmoble right fn-clear">
				<div class="jiedian">节点列表</div>
				<div class="jie_dian ">
				<?php
				$sql_zone = "SELECT * FROM zone ORDER BY id ASC";
				$row_zone = select($sql_zone,$DB);
				foreach ($row_zone as $key => $value) {
				?>
					<dl>
						<dt><?php echo $value['Area']; ?></dt>
						<dd>
						<?php
						$sql_version = "SELECT * FROM version WHERE  zone_id= '{$value['id']}'";
						$row_version = select($sql_version,$DB);
						foreach ($row_version as $key => $value) {
						?>
						<a href="../index.php?id=<?php echo $value['id']; ?>"><?php echo $value['AdvancedEdu']; ?></a>
						<?php } ?>
						</dd>		
					</dl>
				<?php } ?>	
				</div>
				<div class="tag">
					<div class="tag_table">标签列表</div>
					<div class="tagtable">
					<dd>		
						<a href="">模板</a>
						<a href="">拓展字段</a>
					</dd>
					</div>
				</div>
				<div class="jiedian">热门话题</div>
				<div class="jie_dian ">
				</div>
				<div class="tag">
					<div class="tag_table">精华话题</div>
					<div class="tagtable">
					</div>
				</div>
			</div>
	</div>
		<div class="bottom">
			<div class="bottom_table auto"><?php echo $row_123[0]['ICP'] ?></div>
		</div>
</body>
</html>